from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
# 启动浏览器
driver=webdriver.Edge()
# 窗口最大化
driver.maximize_window()
driver.get('https://www.baidu.com/Index.htm')
# 隐式等待
driver.implicitly_wait(10)
# 点击登录按钮
driver.find_element(By.XPATH,'//*[@id="s-top-loginbtn"]').click()
time.sleep(3)
# 输入手机号
driver.find_element(By.NAME,'userName').send_keys('13012558376')
# 输入密码
driver.find_element(By.NAME,'password').send_keys('123456Aa')
# 点击授权协议
driver.find_element(By.XPATH,'//input[@name="isAgree" and @id="TANGRAM__PSP_11__isAgree"]').click()
# 点击登录按钮
driver.find_element(By.CSS_SELECTOR,'#TANGRAM__PSP_11__submit').click()
# 强制等待
time.sleep(10)























